package de.tum.in.eist.im.shared;

import java.io.Serializable;

/**
 * Represents a message in EIST_IM environment. A message consist of a text, a
 * timestamp, and a sender.
 * 
 * @author zardosht
 * 
 */
public class Message implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private long timestamp;
	private String text;
	private Group toGroup;
	private User sender;

	public Message() {
	}

	public Message(long timestamp, String text, User sender, String group) {
		super();
		this.timestamp = timestamp;
		this.text = text;
		this.sender = sender;
		this.toGroup = null;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public String getText() {
		return text;
	}

	public User getSender() {
		return sender;
	}

	public void setToGroup(Group g) {
		this.toGroup = g;
	}

	public Group getToGroup() {
		return toGroup;
	}
}
